package com.alone.wchat.wxBackend.config;

import com.cybermkd.mongo.kit.MongoKit;
import com.cybermkd.mongo.plugin.MongoPlugin;
import com.mongodb.MongoClient;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * created by weirdor on 2018/4/24
 */
@Configuration
public class WeinXinConfig {

    @Bean
    public MongoClient mongoPlugin(){
        MongoPlugin mongoPlugin=new MongoPlugin();
        mongoPlugin.add("39.106.119.195",27017);
        mongoPlugin.setDatabase("poi");
        MongoClient client = mongoPlugin.getMongoClient();
        MongoKit.INSTANCE.init(client, mongoPlugin.getDatabase());
        return client;
    }
}
